package com.homework;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/27 20:27
 * @description
 */
public class T10 {
    public static void main(String[] args) {
        String s = "   i love me   ";
        while (true){
            int index = s.indexOf(" ");
            if (index!=0){
                break;
            }
            s = s.substring(index+1);
        }
        while (true){
            int index = s.lastIndexOf(" ");
            if (index!=s.length()-1){
                break;
            }
            s = s.substring(0,index);
        }
        System.out.println(s);
    }
}
